package com.jackrain.clouddata.sys.Listenter;

import com.alibaba.fastjson.JSONArray;
import com.jackrain.clouddata.oms.dao.RetSaleDao;
import com.jackrain.nea.exception.NDSException;
import com.jackrain.nea.util.ApplicationContextHandle;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * by bigzhi
 */
@Component("com.jackrain.clouddata.sys.Listenter.RetSaleMessageProcess")
@Slf4j
public class RetSaleMessageProcess implements MessageProcess {

    @Override
    public void process(Object paramObject, String tag) throws Exception{
        JSONArray paramArray = JSONArray.parseArray(paramObject.toString());
        RetSaleDao retSaleDao = ApplicationContextHandle.getBean(RetSaleDao.class);
        try{
            if(paramArray != null && paramArray.size() > 0){ //判空 和 size
                retSaleDao.insertRetSale(paramArray, tag);
            }
        }catch(Exception e){
            throw e;
        }

    }

}
